﻿using System;
using System.Windows.Forms;

namespace TreeViewLearn
{
    public partial class Form4 : Form
    {

        public string NodeName
        {
            get { return textBox1.Text.Trim();  }
            set { textBox1.Text = value.Trim(); }
        }
        public Form4()
        {
            InitializeComponent();
        }
        public Form4(string nodename)
        {
            InitializeComponent();
            NodeName = nodename;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textBox1.Text.Trim()))
            {
                MessageBox.Show("请填写节点名称！");
                return;
            }
            DialogResult = DialogResult.OK;
        }
    }
}
